package com.lucenten.collect.gnss.service.impl;

import javax.annotation.Resource;

import cn.quevo.common.entity.PageResult;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.lucenten.collect.gnss.dao.ObsErvationDao;
import com.lucenten.collect.gnss.entity.ObsErvation;
import com.lucenten.collect.gnss.entity.query.ObsErvationQuery;
import com.lucenten.collect.gnss.service.ObsErvationService;

import java.util.Map;

/**
 * O文件实时统计信息 Service接口实现
 *
 * @author July july_sky@foxmail.com
 * @version 1.0
 * @date 2019/04/28 22:22:41
 * @Copyright 东方浩星（北京）传媒科技有限公司版权所有.All Rights Reserved.
 */
@Service("obsErvationService")
@Transactional(transactionManager="transactionManager",rollbackFor={Exception.class})
public class ObsErvationServiceImpl implements ObsErvationService {
    @Resource(name="obsErvationDao")
    private ObsErvationDao obsErvationDao;

    @Override
    public Map<String,Object> getSinge(ObsErvationQuery obsErvationQuery) {
        return this.obsErvationDao.getSinge(obsErvationQuery);
    }

    @Override
    public Integer create(ObsErvation obsErvation) {
        obsErvation.validateCreate();
        return this.obsErvationDao.insert(obsErvation);
    }

    @Override
    public Integer update(ObsErvation obsErvation) {
        obsErvation.validateUpdate();
        return this.obsErvationDao.update(obsErvation);
    }

    @Override
    public PageResult<Map<String,Object>> getPage(ObsErvationQuery obsErvationQuery) {
        return this.obsErvationDao.getPage(obsErvationQuery);
    }
}
